Engine control device

ABSTRACT

To detect a stroke reliably at the time of the start of the engine when a stroke cannot be detected based on crank pulses alone.  
     A stroke is detected based on a difference ΔN between the engine rotational speeds at top and bottom dead centers and a flag F N  is changed depending upon whether a temporary stroke set before a stroke has been detected and the detected stroke coincide with each other or not. Simultaneously, a stroke is detected based on a difference ΔP between the intake air pressures at two bottom dead centers and a flag F P  is changed depending upon whether a temporary stroke set before a stroke has been detected and the detected stroke coincide with each other or not. Then, when the flags F N  and F P  coincide with each other, the stroke detection is completed. When the detected stroke differs from the temporary stroke, the stroke is shifted by a phase of 360° and the crank pulses are renumbered.

TECHNICAL FIELD

This invention relates to an engine control device for controlling anengine and, more specifically to an engine control device suitable forcontrolling an engine provided with a fuel injection device forinjecting fuel.

BACKGROUND ART

With the widespread use of fuel injection devices called injectors inrecent years, control of fuel injection timing and fuel injectionamount, namely, the air-fuel ratio has become easy, which makes itpossible to improve engine output and fuel consumption and to cleanexhaust gas. As to the fuel injection timing, it is common that thephase state of a camshaft, the state of an intake valve, to be exact, isdetected, and, based on the detected result, fuel is injected. However,a cam sensor for detecting the phase state of a camshaft, which isexpensive and increases the size of a cylinder head, is difficult toemploy in motorcycles or the like, in particular. To solve this problem,an engine control device adapted to detect the phase state of acrankshaft and an intake air pressure and, based on those, to detect thestroke state of a cylinder is proposed in JP-A-H10-227252. With thisprior art, it is possible to detect the stroke state of a cylinderwithout detecting the phase of a camshaft, so that it is possible tocontrol fuel injection timing based on the stroke state.

The stroke state can be detected based on variation in engine rotationalspeed during one cycle. The engine rotational speed is highest in theexpansion (explosion) stroke, followed by the exhaust stroke, intakestroke and compression stroke in that order. Thus, the stroke state canbe detected from variation in engine rotational speed and the phase of acrankshaft. An engine control device disclosed in JP-A-2000-337206 isadapted to select stroke detection based on variation in intake airpressure or stroke detection based on variation in engine rotationalspeed according to the operating condition of the engine and detect astroke by the selected method.

With the engine control device disclosed in JP-A-2000-337206, however,it is difficult to select an appropriate stroke detection method overthe entire operating conditions of the engine and, in some cases,neither of the stroke detection methods is appropriate. Thus, thereliability of the detected stroke is low.

The present invention has been made to solve the above problem and it isan object of the present invention to provide an engine control devicewhich can perform stroke detection with high reliability.

DISCLOSURE OF THE INVENTION

In order to solve the foregoing problem, the engine control device ofthe present invention comprises:

-   -   crankshaft phase detecting means for detecting the phase of a        crankshaft,    -   intake air pressure detecting means for detecting the intake air        pressure in an intake pipe of an engine,    -   stroke detecting means for detecting a stroke of the engine        based on at least the phase of the crankshaft detected by the        crankshaft phase detecting means,    -   engine control means for controlling the operating condition of        the engine based on the stroke of the engine detected by the        stroke detecting means and the intake air pressure detected by        the intake air pressure detecting means, and    -   engine rotational speed detecting means for detecting the engine        rotational speed,    -   wherein the stroke detecting means detects a stroke based on        variation in intake air pressure detected by the intake air        pressure detecting means and detects a stroke based on variation        in engine rotational speed detected by the engine rotational        speed detecting means, and completes stroke detection when the        detected strokes coincide with each other.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of an engine for a motorcycle and acontrol device therefor;

FIG. 2 is an explanatory view illustrating a principle of outputtingcrank pulses in the engine in FIG. 1;

FIG. 3 is a block diagram illustrating one embodiment of the enginecontrol device of the present invention;

FIG. 4 is a flowchart illustrating an operation performed in the strokedetection permitting part in FIG. 3;

FIG. 5 is an explanatory view illustrating a process of detecting thestroke state from the phase of a crankshaft and the intake air pressure;

FIG. 6 is a flowchart illustrating an operation performed in the cranktiming detecting part in FIG. 3;

FIG. 7 is a map stored in an in-cylinder air mass calculating part foruse in calculating the air mass in a cylinder;

FIG. 8 is a map stored in a target air-fuel ratio calculating part foruse in calculating a target air-fuel ratio;

FIG. 9 is an explanatory view illustrating the operation of a transitioncorrection part;

FIG. 10 is a flowchart illustrating an operation performed in the fuelinjection amount calculating part in FIG. 3;

FIG. 11 is a flowchart illustrating an operation performed in theignition timing calculating part in FIG. 3;

FIG. 12 is an explanatory view of ignition timing set in the operationshown in FIG. 10;

FIG. 13 is an explanatory view illustrating an operation at a start ofthe engine by the operation shown in FIG. 3; and

FIG. 14 is an explanatory view illustrating an operation at a start ofthe engine by the operation shown in FIG. 3.

BEST MODE FOR CARRYING OUT THE INVENTION

Description will be hereinafter made of the embodiment of thisinvention.

FIG. 1 is a schematic diagram illustrating an example of an engine for amotorcycle or the like and a control device therefor. Designated as thereference numeral 1 is a relatively small displacement, single-cylinder,four-cycle engine. The engine 1 has a cylinder body 2, a crankshaft 3, apiston 4, a combustion chamber 5, an intake pipe 6, an intake valve 7,an exhaust pipe 8, an exhaust valve 9, a spark plug 10 and an ignitioncoil 11. In the intake pipe 6, a throttle valve 12 which is opened andclosed in accordance with throttle opening is provided and an injector13 as a fuel injection device is disposed downstream of the throttlevalve 12. The injector 13 is connected to a filter 18, a fuel pump 17and a pressure control valve 16 which are housed in a fuel tank 19.

The operating condition of the engine 1 is controlled by an enginecontrol unit 15. As means for performing control input into the enginecontrol unit 15, namely means for detecting the operating condition ofthe engine 1, there are provided a crank angle sensor 20 for detectingthe rotational angle, namely phase, of the crankshaft 3, a cooling watertemperature sensor 21 for detecting the temperature of the cylinder body2 or cooling water, namely the temperature of the engine body, anexhaust air-fuel ratio sensor 22 for detecting the air-fuel ratio in theexhaust pipe 8, an intake air pressure sensor 24 for detecting thepressure of intake air in the intake pipe 6, and an intake temperaturesensor 25 for detecting the temperature in the intake pipe 6, namely thetemperature of intake air. The engine control unit 15 receives detectingsignals from the sensors and outputs control signals to the fuel pump17, the pressure control valve 16, the injector 13 and the ignition coil11.

Here, the principle of crank angle signals which are output from thecrank angle sensor 20 will be described. In this embodiment, a pluralityof teeth 23 are formed on an outer periphery of the crankshaft 3 atgenerally equal intervals as shown in FIG. 2a. The crank angle sensor20, such as a magnetic sensor, detects the approach of the teeth 23, andthe resulting current is electrically processed and output as pulsesignals. The circumferential pitch between two adjacent teeth 23 is 300in the phase (rotational angle) of the crankshaft 3, and thecircumferential width of each of the teeth 23 is 10° in the phase(rotational angle) of the crankshaft 3. There is a part where twoadjacent teeth are arranged not at the above pitch but at a pitch whichis twice as large as the others. It is a special part where there is notooth where there should be one as shown by phantom lines in FIG. 2 a.This part corresponds to an irregular interval. This part may behereinafter also referred to as “tooth missing part”.

Thus, when the crankshaft 3 is rotating at a constant speed, the trainof pulse signals corresponding to the teeth 23 appears as shown in FIG.2 b. FIG. 2 a shows the state where the cylinder is at compression topdead center (the state is the same as when the cylinder is at exhausttop dead center). The pulse signal output immediately before thecylinder reaches compression top dead center is numbered as “0”, and thefollowing pulse signals are numbered as “1”, “2”, “3” and “4”. The toothmissing part, which comes after the tooth 23 corresponding to the pulsesignal “4”, is counted as one tooth as if there were one there, and thepulse signal corresponding to the next tooth 23 is numbered as “6”. Whenthis process is continued, the tooth missing part comes again after apulse signal “16”. The tooth missing part is again counted as one toothas above, and the pulse signal corresponding to the next tooth 23 isnumbered as “18”. When the crankshaft 3 rotates twice, the four strokesof one cycle complete, so that the pulse signal which appears after thepulse signal “23” is numbered as “0” again. In principle, the cylinderreaches compression top dead center immediately after the pulse signalsnumbered as “0” appear. The thus detected pulse signal train or eachpulse signal is defined as a “crank pulse”. When stroke detection isperformed based on the crank pulse as described later, crank timing canbe detected. The teeth 23 may be formed on an outer periphery of amember which is rotated in synchronization with the crankshaft 3.

The engine control unit 15 is constituted of a microcomputer (not shown)and so on. FIG. 3 is a block diagram illustrating an embodiment of theengine control operation performed by the microcomputer in the enginecontrol unit 15. The engine control operation is performed by an enginerotational speed calculating part 26 for calculating the enginerotational speed based on a crank angle signal, a crank timing detectingpart 27 for detecting crank timing information, namely the stroke state,based on the crank angle signal, an intake air pressure signal and theengine rotational speed calculated in the engine rotational speedcalculating part 26, a stroke detection permitting part 29 which readsthe engine rotational speed calculated in the engine rotational speedcalculating part 26 and outputs stroke detection permitting informationto the crank timing detecting part 27 and which reads and outputs strokedetection information provided by the crank timing detecting part 27, anin-cylinder air mass calculating part 28 for calculating the air mass inthe cylinder (amount of intake air) based on the crank timinginformation detected by the crank timing detecting part 27 together withan intake air temperature signal, a cooling water temperature (enginetemperature) signal, the intake air pressure signal and the enginerotational speed calculated in the engine rotational speed calculatingpart 26, a target air-fuel ratio calculating part 33 for calculating atarget air-fuel ratio based on the engine rotational speed calculated inthe engine rotational speed calculating part 26 and the intake airpressure signal, a fuel injection amount calculating part 34 forcalculating a fuel injection amount and fuel injection timing based onthe target air-fuel ratio calculated in the target air-fuel ratiocalculating part 33, the intake air pressure signal, the air mass in thecylinder calculated in the in-cylinder air mass calculating part 28, thestroke detection information output from the stroke detection permittingpart 29, and the cooling water temperature signal, an injection pulseoutput part 30 for outputting injection pulses corresponding to the fuelinjection amount and the fuel injection timing calculated in the fuelinjection amount calculating part 34 to the injector 13 based on thecrank timing information detected by the crank timing detecting part 27,an ignition timing calculating part 31 for calculating ignition timingfrom the engine rotational speed calculated in the engine rotationalspeed calculating part 26, the target air-fuel ratio set by the targetair-fuel ratio calculating part 33, and the stroke detection informationoutput from the stroke detection permitting part 29, and an ignitionpulse output part 32 for outputting ignition pulses corresponding to theignition timing set by the ignition timing calculating part 31 to theignition coil 11 based on the crank timing information detected by thecrank timing detecting part 27.

The engine rotational speed calculating part 26 calculates therotational speed of the crankshaft as an output shaft of the engine asthe engine rotational speed based on the rate of change of the crankangle signal with time. More specifically, the engine rotational speedcalculating part 26 calculates an instantaneous value of the enginerotational speed by dividing the phase between two adjacent teeth 23 bytime needed to detect corresponding crank pulses and an average enginerotational speed that is an average movement distance of the teeth 23.

The stroke detection permitting part 29 outputs stroke detectionpermitting information to the crank timing detecting part 27 accordingto the operation shown in FIG. 4. As described before, it takes at leasttwo rotations of the crankshaft 3 to detect a stroke based on crankpulses and it is necessary for the crank pulses including the toothmissing part to be stable during that time. In a relatively smalldisplacement, single-cylinder engine as in this embodiment, however, therotating state is unstable during cranking as it is called at the timeof starting. Thus, the stroke detection is permitted after judgment ofthe rotating state of the engine is made according to the operationshown in FIG. 4.

The operation shown in FIG. 4 is performed using an input of a crankpulse as a trigger. Although there is provided no the step forcommunication in the flowchart, the information obtained through theoperation is accordingly stored in a memory in an overwriting manner andinformation and programs necessary for the operation are read out fromthe memory as needed.

At first in this operation, the instantaneous engine speeds at top andbottom dead centers calculated in the engine rotational speedcalculating part 26 are read in the step S11.

Then, the process goes to the step S12, in which it is judged whetherthe difference between the instantaneous engine rotational speeds at topand bottom dead centers read in the step S11 is not smaller than apredetermined prescribed rotational speed for detecting an initialexplosion corresponding to a rotational speed at an initial explosion.If the difference between the instantaneous engine rotational speeds isnot smaller than the prescribed rotational speed for detecting aninitial explosion, the process goes to the step S13. Otherwise, theprocess goes to the step S14.

In the step S13, an initial explosion is detected and output. Then, theprocess goes to the step S14.

In the step S14, an average engine rotational speed calculated in theengine rotational speed calculating part 26 is read.

The process is then goes to the step S15, in which it is judged whetherthe average engine rotational speed read in the step S14 is not lowerthan a predetermined prescribed rotational speed for detecting acomplete explosion corresponding to a rotational speed at a completeexplosion. If the average engine rotational speed is not lower than therotational speed for detecting a complete explosion, the process goes tothe step S16. Otherwise, the process goes to the step S17.

In the step S16, a complete explosion is detected and output. Then, theprocess goes to the step S17.

In the step S17, it is judged whether there was an output of initialexplosion detection in the step S13 or whether there was an output ofcomplete explosion detection in the step S16. If there was an output ofinitial explosion detection or complete explosion detection, the processgoes to the step S18. Otherwise, the process goes to the step S19.

In the step S18, information that stroke detection is permitted isoutput. Then, the process returns to a main program.

In the step S19, information that stroke detection is not permitted isoutput. Then, the process returns to the main program.

According to the operation, stroke detection is permitted after aninitial explosion has taken place in the engine or the average enginerotational speed reaches a value corresponding to a rotational speed ata complete explosion. Thus, stable crank pulses can be obtained and astroke can be detected with accuracy.

The crank timing detecting part 27, which has a constitution similar tothe stroke judging device disclosed in JP-A-H10-227252, detects a strokebased on variation in intake air pressure and a stroke based onvariation in engine rotational speed and outputs information on thestroke state as crank timing information. Here, the principle ofdetection of a stroke based on variation in intake air pressure will bedescribed. In a four-stroke engine, the crankshaft and the camshaft areconstantly rotated with a prescribed phase difference, so that whencrank pulses are read as shown in FIG. 5, the fourth crank pulse afterthe tooth missing part, namely the crank pulse “9” or “21”, representseither an exhaust stroke or a compression stroke. As is well known,during an exhaust stroke, the exhaust valve is opened and the intakevalve is closed, so that the intake air pressure is high. However, in anearly stage of a compression stroke, the intake air pressure is lowbecause the intake valve is still open or because of the previous intakestroke even if the intake valve is closed. Thus, the crank pulse “21”output when the intake air pressure is low indicates that the cylinderis on a compression stroke, and the cylinder reaches compression topdead center immediately after the crank pulse “0” is obtained. Morespecifically, when the difference between the intake air pressures attwo bottom dead centers is a prescribed negative value or smaller, thecylinder is at bottom dead center after an intake stroke and when thedifference is a prescribed positive value or greater, the cylinder is atbottom dead center before an exhaust stroke. When a stroke can bedetected as above, it is possible to detect the present stroke state infurther detail by interpolating the intervals between the strokes withthe rotational speed of the crankshaft.

The engine rotational speed is highest in the expansion stroke in thefour strokes: intake, compression, expansion (explosion) and exhaust,followed, in this order, by exhaust stroke, intake stroke andcompression stroke. By combining the variation in engine rotationalspeed and the phase of the crankshaft represented by crank pulses, astroke can be detected as in the case with the stroke detection based onvariation in intake air pressure. More specifically, when the differencebetween the engine rotational speeds at top and bottom dead centers is aprescribed negative value or smaller, the cylinder is at bottom deadcenter after an intake stroke, and when the difference is a prescribedpositive value or greater, the cylinder is at bottom dead center beforean exhaust stroke.

Thus, the crank timing detecting part 27 performs an operation shown inFIG. 6 for setting the operation mode and detecting a stroke. Theoperation shown in FIG. 6 is performed using an input of a crank pulse,for example, as a trigger. Although there is provided no the step forcommunication in the flowchart, the information obtained through theoperation is accordingly stored in the memory in an overwriting mannerand information and programs necessary for the operation are read outfrom the memory as needed.

At first in this operation, it is judged whether the operation mode hasbeen set to “4” in the step S101. If the operation mode has been set to“4”, the process returns to a main program. Otherwise, the process goesto the step S102.

In the step S102, it is judged whether the operation mode has been setto “3”. If the operation mode has been set to “3”, the process goes tothe step S114. Otherwise, the process goes to the step S104.

In the step S104, it is judged whether the operation mode has been setto “2”. If the operation mode has been set to “2”, the process goes tothe step S105. Otherwise, the process goes to the step S106.

In the step S106, it is judged whether the operation mode has been setto “1”. If the operation mode has been set to “1”, the process goes tothe step S107. Otherwise, the process goes to the step S108.

In the step S108, the operation mode is set to “0”. Then, the processgoes to the step S109.

In the step S109, it is judged whether a prescribed number or more ofcrank pulses are detected within a prescribed period of time. If aprescribed number or more of crank pulses are detected within aprescribed period of time, the process goes to the step S110. Otherwise,the process returns to the main program.

In the step S110, the operation mode is set to “1”. Then, the processgoes to the step S107.

In the step S107, it is judged whether the tooth missing part has beendetected. If the tooth missing part has been detected, the process goesto the step S111. Otherwise, the process returns to the main program.When a value obtained by dividing the width T₂ of an OFF-part by theaverage of the widths T₁ and T₃ of the pulses before and after theOFF-part (the widths T₁ to T₃ are represented by time) is greater than aprescribed value α, the part is judged as the tooth missing part.

In the step S111, the operation mode is set to “2”. Then, the processgoes to the step S105.

In the step S105, it is judged whether the tooth missing part has beendetected twice in succession. If the tooth missing part has beendetected twice in succession, the process goes to the step S112.Otherwise, the process returns to the main program.

In the step S112, it is judged whether an initial or a completeexplosion in the engine has been detected. If an initial or a completeexplosion has been detected, the process goes to the step S113.Otherwise, the process returns to the main program.

In the step S113, the operation mode is set to “3”. Then, the processgoes to the step S114.

In the step S114, it is judged whether the cylinder is now at bottomdead center based on the state of the crank pulses. If the cylinder isat bottom dead center, the process goes to the step S115. Otherwise, theprocess goes to the step S116.

In the step S115, an engine rotational speed difference ΔN iscalculated. Then, the process goes to the step S117. The enginerotational speed difference ΔN is obtained by subtracting the enginerotational speed at the previous top dead center from the present enginerotational speed.

In the step S117, it is judged whether the engine rotational speeddifference ΔN calculated in the step S115 is not smaller than apredetermined positive threshold value ΔN_(EX) of engine rotationalspeed difference before exhaust stroke. If the engine rotational speeddifference ΔN is not smaller than the threshold value ΔN_(EX) of enginerotational speed difference before exhaust stroke, the process goes tothe step S118. Otherwise, the process goes to the step S119.

In the step S119, it is judged whether the engine rotational speeddifference ΔN calculated in the step S115 is not greater than apredetermined negative threshold value ΔN_(IN) of engine rotationalspeed difference after intake stroke. If the engine rotational speeddifference ΔN is not greater than the threshold value ΔN_(IN) of enginerotational speed difference after intake stroke, the process goes to thestep S118. Otherwise, the process goes to the step S120.

In the step S118, stroke detection based on the engine rotational speeddifference ΔN is performed as described before. Then, process goes tothe step S121.

In the step S121, it is judged whether the stroke detected in the stepS118 coincides with a temporary stroke set before the stroke wasdetected. If the detected stroke coincides with the temporary stroke,the process goes to the step S122. Otherwise, the process goes to thestep S123.

In the step S122, a flag F_(N) for stroke detection based on enginerotational speed difference is set to “1”. Then, the process goes to thestep S124.

In the step S123, the flag F_(N) for stroke detection based on enginerotational speed difference is set to “2”. Then, the process goes to thestep S124.

In the step S124, a counter CNT_(N) for stroke detection based on enginerotational speed difference is incremented. Then, the process goes tothe step S125.

In the step 125, it is judged whether the flag F_(N) for strokedetection based on engine rotational speed difference has been set to“1” and whether the counter CNT_(N) for stroke detection based on enginerotational speed difference is at a value which is not smaller than apredetermined prescribed value CNT_(N0). If the flag F_(N) for strokedetection based on engine rotational speed difference has been set to“1” and the counter CNT_(N) for stroke detection based on enginerotational speed difference is at a value which is not smaller than theprescribed value CNT_(N0), the process goes to the step S126. Otherwise,the process goes to the step S116.

In the step S126, detection of a temporary stroke based on an enginerotational speed difference is regarded as having been completed. Then,the process goes to the step S116.

In the step S120, the flag F_(N) for stroke detection based on enginerotational speed difference is reset to “0”. Then, the process goes tothe step S127.

In the step S127, the counter CNT_(N) for stroke detection based onengine rotational speed difference is cleared to “0”. Then, the processgoes to the step S116.

In the step S116, it is judged whether the cylinder is at bottom deadcenter based on the state of the crank pulses. If the cylinder is atbottom dead center, the process goes to the step S128. Otherwise, theprocess goes to the step S129.

In the step S128, an intake air pressure difference ΔP is calculated.Then, the process goes to the step S130. The intake air pressuredifference ΔP is obtained by subtracting the intake air pressure at theprevious bottom dead center from the present intake air pressure.

In the step S130, it is judged whether the intake air pressuredifference ΔP calculated in the step S128 is not smaller than apredetermined positive threshold value ΔP_(EX) of intake air pressuredifference before exhaust stroke. If the intake air pressure differenceΔP is not smaller than the threshold value ΔP_(EX) of intake airpressure difference before exhaust stroke, the process goes to the stepS131. Otherwise, the process goes to the step S132.

In the step S132, it is judged whether the intake air pressuredifference ΔP calculated in the step S128 is not greater than apredetermined negative threshold value ΔP_(IN) of intake air pressuredifference after intake stroke. If the intake air pressure difference ΔPis not greater than the threshold value ΔP_(IN) of intake air pressuredifference after intake stroke, the process goes to the step S131.Otherwise, the process goes to the step S133.

In the step S131, stroke detection based on the intake air pressuredifference ΔP is performed as described before. Then, the process goesto the step S134.

In the step S134, it is judged whether the stroke detected in the stepS131 coincides with a temporary stroke set before the stroke wasdetected. If the detected stroke coincides with the temporary stroke,the process goes to the step S135. Otherwise, the process goes to thestep S136.

In the step S135, a flag F_(P) for stroke detection based on intake airpressure difference is set to “1”. Then, the process goes to the stepS137.

In the step S136, the flag F_(P) for stroke detection based on intakeair pressure difference is set to “2”. Then, the process goes to thestep S137.

In the step S137, a counter CNT_(P) for stroke detection based on intakeair pressure difference is incremented. Then, the process goes to thestep S138.

In the step S138, it is judged whether the flag F_(P) for strokedetection based on intake air pressure difference has been set to “1”and whether the counter CNT_(P) for stroke detection based on intake airpressure difference is at a value which is not smaller than apredetermined prescribed value CNT_(P0). If the flag F_(P) for strokedetection based on intake air pressure difference has been set to “1”and the counter CNT_(P) for stroke detection based on intake airpressure difference is at a value which is not smaller than theprescribed value CNT_(P0), the process goes to the step S139. Otherwise,the process goes to the step S129.

In the step S139, detection of a temporary stroke based on an intake airpressure difference is regarded as having been completed. Then, theprocess goes to the step S129.

In the step S133, the flag F_(P) for stroke detection based on intakeair pressure difference is reset to “0”. Then, the process goes to thestep S140.

In the step S140, the counter CNT_(P) for stroke detection based onintake air pressure difference is cleared to “0”. Then, the process goesto the step S129.

In the step S129, it is judged whether the counter CNT_(N) for strokedetection based on engine rotational speed difference is at a valuewhich is not lower than the prescribed value CNT_(N0) or the counterCNT_(P) for stroke detection based on intake air pressure difference isat a value which is not lower than the prescribed value CNT_(P0). Ifeither is the case, the process goes to the step S141. Otherwise, theprocess returns to the main program.

In the step S141, it is judged whether the flag F_(N) for strokedetection based on engine rotational speed difference has been set to“1” and whether the flag F_(P) for stroke detection based on intake airpressure difference has been set to “1”. Both the flags have been set to“1”, the process goes to the step S142. Otherwise, the process goes tothe step S143.

In the step S143, it is judged whether the flag F_(N) for strokedetection based on engine rotational speed difference has been set to“2” and whether the flag F_(P) for stroke detection based on intake airpressure difference has been set to “2”. Both the flags have been set to“2”, the process goes to the step S144. Otherwise, the process goes tothe step S145.

In the step S142, the temporary stroke set before the stroke wasdetected is determined as the true stroke as it is and the strokedetection is completed. Then, the process goes to the step S146.

In the step S144, the temporary stroke is shifted by a phase of 360°,namely by a phase corresponding to a rotation of the crankshaft, anddetermined as the true stroke. More specifically, the crank pulse “12”is renumbered. Then, the process goes to the step S146.

In the step S145, a fail counter CNT_(F) is incremented. Then, theprocess goes to the step S146.

In the step S146, it is judged whether the fail counter CNT_(F) is at avalue which is not lower than a predetermined prescribed value CNT_(F0).If the fail counter CNT_(F) is at a value which is not lower than theprescribed value CNT_(F0), the process goes to the step S148. Otherwise,the process goes to the step S146.

In the step S146, the fail counter CNT_(F) is cleared to “0”. Then, theprocess goes to the step S149.

In the step S149, the operation mode is set to “4”. Then, the processreturns to the main program.

In the step S148, a prescribed fail safe process is performed. Then, theprogram is ended. Examples of the fuel safe process include lowering theengine torque gradually by decreasing the frequency of ignitiongradually, shifting the ignition in the cylinder to the lag sidegradually, or closing the throttle quickly at first and then slowly oran indication of abnormality.

According to the operation, at the start of the engine or the like, theoperation mode is set to “1” when a prescribed number or more of crankpulses are detected within a prescribed period of time, and set to “2when the tooth missing part is detected. Then, when the tooth missingpart is detected twice in succession and the stroke detection permittingpart 29 detects an initial or a complete explosion and permits strokedetection, the operation mode is set to “3”. Then, as described before,it is judged whether the difference ΔN between the engine rotationalspeeds at top and bottom dead centers is not smaller than the thresholdvalue ΔN_(EX) of engine rotational speed difference before exhauststroke or not greater than the threshold value ΔN_(IN) of enginerotational speed difference after intake stroke to perform strokedetection based on an engine rotational speed difference.Simultaneously, it is judged whether the difference ΔP between intakeair pressures at two bottom dead centers is not smaller than thethreshold value ΔP_(EX) of intake air pressure difference before exhauststroke or not greater than the threshold value ΔP_(IN) of intake airpressure difference after intake stroke to perform stroke detectionbased on an intake air pressure difference. Then, either of the strokedetections is repeated prescribed number CNT_(N0) or CNT_(P0) of times.Then, when the detected stroke coincides with the temporary stroke,namely, when the stroke detection flag F_(N) or F_(P) is set to “1”, thetemporary detection is completed.

Moreover, the stroke detection based on an engine rotational speeddifference ΔN is repeated at least a prescribed value CNT_(N0) of timesor the stroke detection based on an intake air pressure difference ΔP isrepeated at least a prescribed value CNT_(P0) of times. Then, when thetemporary stroke coincides with the detected stroke, namely the flagF_(N) for stroke detection based on engine rotational speed differenceis set to “1” as a result of the stroke detection based on an enginerotational speed difference ΔN and when the temporary stroke coincideswith the detected stroke, namely the flag F_(P) for stroke detectionbased on intake air pressure difference is set to “1” as a result of thestroke detection based on an intake air pressure difference ΔP, thetemporary stroke is determined as the true stroke as it is. Thereby, thestroke detection is completed. Then, the operation mode is set to “4”.When the temporary stroke differs from the detected stroke, namely theflag F_(N) for stroke detection based on engine rotational speeddifference is set to “2” as a result of the stroke detection based on anengine rotational speed difference ΔN and when the temporary strokediffers from the detected stroke, namely the flag F_(P) for strokedetection based on intake air pressure difference is set “2” as a resultof the stroke detection based on an intake air pressure difference ΔP,the temporary stroke is shifted by a phase of 360° and determined as thetrue stroke. Thereby, the stroke detection is completed. Then, theoperation mode is set to “4”. In shifting the phase of the stroke, acrank pulse is renumbered.

The in-cylinder air mass calculating part 28 has a three-dimensional mapas shown in FIG. 7 for use in calculating the air mass in the cylinderbased on an intake air pressure signal and an engine rotational speedcalculated in the engine rotational speed calculating part 26. Thethree-dimensional map for use in calculating the air mass in thecylinder can be obtained only by measuring air mass in the cylinderwhile changing the intake air pressure with the engine rotated at aprescribed rotational speed. The measurement can be conducted with arelatively simple experiment, so that the map can be organized withease. The map could be organized with an advanced engine simulationsystem. The air mass in the cylinder, which is changed with enginetemperature, may be corrected with the cooling water temperature (enginetemperature) signal.

The target air-fuel ratio calculating part 33 has a three-dimensionalmap as shown in FIG. 8 for use in calculating a target air-fuel ratiobased on an intake air pressure signal and an engine rotational speedcalculated in the engine rotational speed calculating part 26. Thethree-dimensional map can be organized on paper to some extent. Ingeneral, the air-fuel ratio is correlated with torque. When the air-fuelratio is low, namely, when the amount of fuel is large and the amount ofair is small, the torque increases but the efficiency decreases.Whereas, when the air-fuel ratio is high, namely, when the amount offuel is small and the amount of air is large, the torque decreases butthe efficiency increases. The state where the air-fuel ratio is low iscalled “rich” and the state where the air-fuel ratio is high is called“lean”. The leanest state is one often referred to as “stoichiometry”,where the ideal air-fuel ratio at which complete combustion of gasolinetakes place, namely, an air-fuel ratio of 14.7 is attained.

The engine rotational speed indicates the operating condition of theengine. In general, the air-fuel ratio is increased when the enginerotational speed is high and decreased when the engine rotational speedis low. This is to enhance torque responsiveness in the low rotationalspeed range and to enhance rotation responsiveness in the highrotational speed range. The intake air pressure indicates the engineload such as the throttle opening. In general, when the engine load islarge, namely, when the throttle opening is large and the intake airpressure is high, the air-fuel ratio is decreased and when the engineload is small, namely, when the throttle opening is small and the intakeair pressure is low, the air-fuel ratio is increased. This is becausetorque is important when the engine load is large and efficiency isimportant when the engine load is small.

As above, the target air-fuel ratio has a physical meaning easy tounderstand and thus can be set to some extent in accordance withrequired engine output characteristics. It is needless to say that theair-fuel ratio may be tuned in accordance with the outputcharacteristics of an actual engine.

The target air-fuel ratio calculating part 33 has a transitioncorrection part 29 for detecting transitions, more specifically,accelerating state and decelerating state of the engine based on anintake air pressure signal and correcting the target air-fuel ratio inresponse thereto. For example, as shown in FIG. 9, the change of theintake air pressure is also a result of an operation of the throttle, sothat an increase of the intake air pressure indicates that the throttleis opened to accelerate the vehicle, namely, the engine is accelerating.When such an accelerating state is detected, the target air-fuel ratiois set to the rich side temporarily and then returned to the originaltarget value. As a method to return the air-fuel ratio to the originalvalue, there may be employed any existing method, such as a method inwhich a weighing coefficient of a weighted mean of the air-fuel ratioset to the rich side during the transition and the original targetair-fuel ratio is gradually changed. When a decelerating state isdetected, the target air-fuel ratio may be set to the lean side than theoriginal target air-fuel ratio to attain high efficiency.

The fuel injection amount calculating part 34 calculates and sets thefuel injection amount and fuel injection timing at the start and duringnormal operation of the engine according to an operation shown in FIG.10. The operation shown in FIG. 10 is performed using an input of acrank pulse as a trigger. Although there is provided no the step forcommunication in the flowchart, the information obtained through theoperation is accordingly stored in the memory in an overwriting mannerand information and programs necessary for the operation are read outfrom the memory as needed.

At first in this operation, stroke detection information output from thestroke detection permitting part 29 is read in the step S21.

Then, the process goes to the step S22, in which it is judged whetherthe stroke detection by the crank timing detecting part 27 has not beencompleted (the operation mode has been set to “3”). When the strokedetection has not been completed, the process goes to the step S23.Otherwise, the process goes to the step S24.

In the step S23, it is judged whether a fuel injection time counter n isat “0”. When the fuel injection time counter n is at “0”, the processgoes to the step S25. Otherwise, the process goes to the step S26.

In the step S25, it is judged whether the next fuel injection is thethird or later fuel injection after the start of the engine. When thenext fuel injection is the third or later fuel injection, the processgoes to the step S27. Otherwise the process goes to the step S28.

In the step S27, the intake air pressures at predetermined prescribedcrank angles during two rotations of the crankshaft, the intake airpressures at the time when the crank pulses “6” and “18” shown in FIG. 2and FIG. 5 are generated in this embodiment, are read out from an intakeair pressure recording part (not shown), and the difference between theintake air pressures is calculated. Then, the process goes to the stepS29.

In the step S29, it is judged whether the difference in intake airpressure calculated in the step S28 is not smaller than a prescribedvalue which is large enough to discriminate a stroke to some extent.When the difference in intake air pressure is not smaller than theprescribed value, the process goes to the step S30. Otherwise, theprocess goes to the step S28.

In the step S30, a total fuel injection amount is calculated based onthe smaller of the two intake air pressures during two rotations of thecrankshaft read in the step S27. Then, the process goes to the step S31.

In the step S28, the cooling water temperature, namely the enginetemperature is read and a total fuel injection amount is calculatedbased on the cooling water temperature. For example, as the coolingwater temperature is lower, the fuel injection amount is increased.Then, the process goes to the step S31. The total fuel injection amountcalculated in the step S28 or the step S30 is the amount of fuel to beinjected once every cycle, namely once every two rotations of thecrankshaft, before the intake stroke. Thus, when a stroke has alreadybeen detected, the engine can be rotated properly according to thecooling water temperature, namely the engine temperature, by injectingan amount of fuel calculated based on the cooling water temperature oncebefore each intake stroke.

In the step S31, half of the total fuel injection amount set in the stepS30 is set as the amount of fuel to be injected this time and the fuelinjection timing is set at a prescribed crank angle during each rotationof the crankshaft, at the time when the crank pulse “10” or “22” shownin FIG. 2 and FIG. 5 falls in this embodiment. Then, the process goes tothe step S32.

In the step S32, the fuel injection time counter is set to “1”. Then,the process returns to a main program.

In the step S24, it is judged whether the previous fuel injection wasperformed immediately before an intake stroke. If the previous fuelinjection was performed immediately before an intake stroke, the processgoes to the step S33. Otherwise, the process goes to the step S26.

In the step S26, the fuel injection amount this time is set to the sameas the previous fuel injection amount and the fuel injection timing isset at a prescribed crank angle during each rotation of the crankshaftin the same manner as in the step S31. Then, the process goes to thestep S34.

In the step S34, the fuel injection time counter is set to “0”. Then,the process returns to the main program.

In the step S33, the fuel injection amount and fuel injection timing fornormal operation are set based on a target air-fuel ratio, an air massin the cylinder, and an intake air pressure. Then, the process goes tothe step S35. More specifically, since the amount of fuel to be suppliedinto the cylinder can be obtained by dividing the air mass calculated inthe in-cylinder air mass calculating part 28 by the target air-fuelratio calculated in the target air-fuel ratio calculating part 33, thefuel injection period can be obtained by multiplying the amount of fuelto be supplied into the cylinder by the flow characteristic of theinjector 13, for example. The fuel injection amount and the fuelinjection timing can be calculated from the fuel injection period.

In the step S34, the fuel injection time counter is set to “0”. Then,the process returns to the main program.

According to the operation, when the crank timing detecting part 27 hasnot completed stroke detection (the operation mode has been set to “3”),half of the total fuel injection amount, with which the engine can berotated properly if it is injected before the intake stroke in eachcycle, is injected at a prescribed crank angle once every rotation ofthe crankshaft. Thus, there is a possibility that only a half of therequired amount of fuel is supplied in the first intake stroke after thestart of cranking at the start of the engine as described later.However, it is possible to reliably produce an explosion to start theengine even if it may be weak when ignition is made at compression topdead center or in the vicinity thereof. When the required amount of fuelis supplied in the first intake stroke after the start of cranking,namely when fuel which has been supplied by two injections, eachperformed during one rotation of the crankshaft, can be sucked into thecylinder, it is possible to obtain a sufficient explosive power to startthe engine reliably.

Even when a stroke has been detected, when the previous fuel injectionwas performed not immediately before an intake stroke, for example,performed before an exhaust stroke, only a half of the required amountof fuel has been injected. Thus, by injecting the same amount of fuel asthe previous injection again, the amount of fuel required to produce asufficient explosive power to start the engine is supplied into thecylinder during the next intake stroke.

Moreover, when the stroke detection has not been completed, the intakeair pressures at predetermined crank angles during two rotations of thecrankshaft are read. More specifically, the intake air pressures at thetime when the crank pulses “6” and “18” shown in FIG. 2 and FIG. 5 aregenerated, namely, the intake air pressures during an intake stroke andan expansion stroke are read. Then, the difference between the intakeair pressures is calculated. As described before, unless the throttlevalve is widely open, there is a large difference between the intake airpressures during an intake stroke and an expansion stroke. When thecalculated intake air pressure difference is not smaller than aprescribed value which is large enough to detect a stroke, the smallerof the two intake air pressures can be regarded as an intake airpressure during an intake stroke. Then, by setting a total fuelinjection amount based on the intake air pressure, which reflects thethrottle opening to some extent, it is possible to obtain an increase inengine rotational speed according to the throttle opening.

When the difference between the intake air pressures at predeterminedcrank angles during two rotations of the crankshaft is smaller than theprescribed value or when fuel is injected immediately after the start ofthe engine, a total fuel injection amount is set based on the coolingwater temperature, namely the engine temperature. Thereby, it is atleast possible to start the engine reliably against friction.

In this embodiment, prior to the operation shown in FIG. 10, a startingasynchronous injection, by which a certain amount of fuel is injectedregardless of the crank pulse, is performed when temporary numbers areattached to the crank pulses while the operation mode is “1”.

The ignition timing calculating part 31 calculates and sets the ignitiontimings at the start and during normal operation of the engine accordingto the operation shown in FIG. 11. The operation shown in FIG. 11 isperformed using an input of a crank pulse as a trigger. Although thereis provided no the step for communication in the flowchart, theinformation obtained through the operation is accordingly stored in thememory in an overwriting manner and information and programs necessaryfor the operation are read out from the memory as needed.

At first in this operation, stroke detection information output from thestroke detection permitting part 29 is read in the step S41.

Then, the process goes to the step S42, in which it is judged whetherthe stroke detection by the crank timing detecting part 27 has not beencompleted (the operation mode has been set to “3”). If the strokedetection has not been completed, the process goes to the step S47.Otherwise, the process goes to the step S44.

In the step S47, the ignition timing for the early stage of the start ofthe engine is set at top dead center (either compression top dead centeror exhaust top dead center will do) during each rotation of thecrankshaft, namely at the fall of the crank pulse “0” or “12” in FIG. 2or FIG. 5 ±a crankshaft rotational angle of 100. This is because theengine rotational speed is low and unstable after the start of crankingand before an explosive power of the initial explosion is obtained atthe start of the engine. Then, the process returns to a main program.The ignition timing is determined taking the electrical or mechanicalresponsiveness into consideration. Substantially, the ignition isperformed simultaneously with the fall of the pulse “0” or “12” in FIG.2 or FIG. 5.

In the step S44, it is judged whether the average engine rotationalspeed is not lower than a prescribed value. When the average enginerotational speed is not lower than the prescribed value, the processgoes to the step S48. Otherwise, the process goes to the step S46.

In the step S46, the ignition timing for the latter stage of the startof the engine is set at 100in advance of compression top dead center ineach cycle, namely at the rise of the pulse “0” in FIG. 12 ±a crankshaftrotational angle of 10°. This is because the engine rotational speed isrelatively high (but still unstable) after an explosive power of theinitial explosion is obtained at the start of the engine. Then, theprocess returns to a main program. The ignition timing is determinedtaking the electrical or mechanical responsiveness into consideration.Substantially, the ignition is performed simultaneously with the rise ofthe pulse “0” or “12” in FIG. 2 or FIG. 5.

In the step S48, the ignition timing is set to the normal ignitiontiming so that ignition can be made once every cycle. Then, the processreturns to the main program. In general, the torque is highest whenignition is made slightly in advance of top dead center. Thus, theignition timing is adjusted with respect to the normal ignition timingin response to the driver's intention of accelerating which isrepresented by the intake air pressure.

In this operation, at the start of cranking before completion of thestroke detection and an initial explosion, namely in the early stage ofthe start of the engine, the ignition timing is set at a point in thevicinity of top dead center during each rotation of the crankshaft inaddition to the fuel injection during each rotation of the crankshaft toprevent reverse rotation of the engine and to start the engine reliably.Even after a stroke has been detected, about 10° in advance ofcompression top dead center, at which a relatively high torque can beobtained, is set as the ignition timing for the latter stage of thestart of the engine to stabilize the engine rotational speed at arelatively high level until the engine rotational speed reaches aprescribed value or higher.

As described above, in this embodiment, the air mass in the cylinder iscalculated based on the intake air pressure and the operating conditionof the engine according to a three-dimensional in-cylinder air mass mapstored in advance and a target air-fuel ratio is calculated based on theintake air pressure and the operating condition of the engine accordingto a target air-fuel ratio map stored in advance, and then the fuelinjection amount can be calculated by dividing the air mass in thecylinder by the target air-fuel ratio. Thus, the control can be easy andprecise. Also, since the in-cylinder air mass map is easy to measure andthe target air-fuel ratio map is easy to organize, the maps can beorganized with ease. Also, there is no need to provide a throttleopening sensor or a throttle position sensor for detecting the engineload.

Also, since a transition, namely, an accelerating state or adecelerating state is detected based on the intake air pressure and thetarget air-fuel ratio is corrected based thereon, it is possible toshift the engine output characteristics during acceleration ordeceleration from ones set according to the target air-fuel ratio map toones required by the driver or ones close to the driver's feeling.

Also, since the engine rotational speed is detected based on the phaseof the crankshaft, it is possible to detect the engine rotational speedwith ease. Also, it is possible to eliminate a cam sensor, which isexpensive and large, when the stroke state is detected based on, forexample, the phase of the crankshaft, not with a cam sensor.

In this embodiment, in which no cam sensor is used, the detection of thephase of the crankshaft and a stroke is important. In this embodiment,in which a stroke is detected based on crank pulses and an intake airpressure, the stroke detection takes at least two rotations of thecrankshaft. However, it is impossible to know during which stroke theengine is stopped, namely it is impossible to know from which strokecranking is started. Thus, in this embodiment, between start of crankingand completion of stroke detection, fuel is injected at a prescribedcrank angle during each rotation of the crankshaft and ignition is madeat a point in the vicinity of compression top dead center during eachrotation of the crank shaft using the crank pulses. After a stroke hasbeen detected, although fuel injection which can attain a targetair-fuel ratio in accordance with the throttle opening is performed onceevery cycle, ignition is made at about 10° in advance of compression topdead center using the crank pulses until the engine rotational speedbecomes a prescribed value or higher so that a large torque can begenerated.

As described above, in this embodiment, fuel is injected at a prescribedcrank angle once every rotation of the crankshaft and ignition is madein the vicinity of compression top dead center once every rotation ofthe crankshaft before a stroke is detected. Thus, it is possible toproduce an initial explosion reliably although it may be weak and it ispossible to prevent reverse rotation of the engine. When ignition ismade in advance of compression top dead center before an initialexplosion is produced, the engine may rotate in reverse. After a strokehas been detected, fuel injection and ignition are performed once everycycle. The ignition is performed at about 100 in advance of compressiontop dead center to increase the engine rotational speed quickly.

If fuel injection and ignition are performed once every cycle, namelyonce every two rotations of the crankshaft, before a stroke is detected,a reliable initial explosion cannot be produced when the fuel injectionis performed after intake or when the ignition is made at a point otherthan compression top dead center. Namely, the engine may or may not bestarted smoothly. If fuel is injected once every rotation of thecrankshaft after a stroke has been detected, fuel must continue to beinjected in a motorcycle, in which the engine is used in a highrotational speed range, and the dynamic range of the injector islimited. Also, continuing ignition once every rotation of the crankshaftafter a stroke has been detected is waste of energy.

Also, stroke detection based on a difference in engine rotational speedand stroke detection based on a difference in intake air pressure aresimultaneously performed, and when the results of the stroke detectionscoincide with each other, the stroke detection is completed. Thus, thelow reliability of each detection method can be compensated, makingstroke detection with high reliability possible.

FIG. 13 shows the variation in crank pulses (only the numbers thereofare shown), operation mode, injection pulses, intake air pressure andengine rotational speed with time at the time when engine is rotatedfrom exhaust top dead center with a starter motor. In this simulation,the prescribed count-up value CNT_(N0) and CNT_(P0) of the strokedetection counters CNT_(N) and CNT_(P) are both “2”. The crank pulsenumbers immediately after the start of rotation are mere count values.In this embodiment, the operation mode is set to “1” when five crankpulses are detected. When the operation mode is set to “1”, temporarynumbers “temp. 0, temp. 1, . . . ” are attached to the crank pulses.When the tooth missing part is detected, the operation mode is set to“2”. After the operation mode has been set to “2”, the crank pulse afterthe tooth missing part is numbered as “6”. As described before, thecrank pulse number “6” should be attached to a crank pulse indicatingbottom dead center after explosion. However, a stroke has not beendetected yet here and the number is attached as a temporary stroke. Inthis embodiment, since the engine is started from exhaust top deadcenter, the number “6” of the crank pulse is incorrect. When the toothmissing part is detected twice in succession and an initial or acomplete explosion is detected, the operation mode is set to “3”.

In this embodiment, when temporary numbers are attached to the crankpulses while the operation mode is “1”, a certain amount of fuel isinjected by the starting asynchronous injection as described before.Also, according to the operation for setting a fuel injection amount andfuel injection timing, when a stroke has not been detected (theoperation mode is “2” or “3”), half of the amount of fuel necessary toone cycle is injected at a prescribed crank angle once every rotation ofthe crankshaft, more specifically, at the time when the crank pulse “7”or “19” is generated. Also, according to the operation for settingignition timing, when the stroke detection has not been completed (theoperation mode is “2” or “3”), ignition pulses are generated so thatignition can be made at a prescribed crank angle once every rotation ofthe crankshaft, more specifically, at the time when the crank pulse “0”or “12” is generated (more specifically, ignition is made when theignition pulse falls). Thus, fuel injected by the starting asynchronousinjection is sucked into the combustion chamber during the intake strokemade by the first rotation of the crankshaft and makes an initialexplosion by ignition at the next compression top dead center, wherebythe engine starts to rotate. Thereby, the engine rotational speedbecomes equal to or higher than a prescribed rotational speed forpermitting stroke detection, and stroke detection is permitted. However,the rotation of the engine is still unstable and the engine has not goneinto a stable idling state.

After the operation mode has been set to “3”, stroke detection based onan engine rotational speed difference ΔN and stroke detection based onan intake air pressure difference ΔP are performed at each bottom deadcenter. However, a stroke cannot be easily detected since the enginerotational speed and the intake air pressure are still unstable. Whenthe engine rotational speed difference ΔN becomes the threshold valueΔN_(IN) of engine rotational speed difference after intake stroke orsmaller at the third bottom dead center, the flag F_(N) for strokedetection based on engine rotational speed difference is set to “2” andthe counter CNT_(N) for stroke detection based on engine rotationalspeed difference is incremented to “1” since the temporary strokediffers from the detected stroke. Then, since the engine rotationalspeed difference ΔN is the threshold value ΔN_(IN) of engine rotationalspeed difference before exhaust stroke or smaller again at the fourthbottom dead center, which means the temporary stroke differs from thedetected stroke, the flag F_(N) for stroke detection based on enginerotational speed difference is kept at “2”, and the counter CNT_(N) forstroke detection based on engine rotational speed difference isincremented and counted up to “2”. At the same time, the intake airpressure difference ΔP becomes the threshold value ΔP_(EX) of intake airpressure difference before exhaust stroke or greater, which means thetemporary stroke differs from the detected stroke, the flag F_(P) forstroke detection based on intake air pressure difference is set to “2”and the counter CNT_(P) for stroke detection based on intake airpressure difference is incremented to “1”. As a result, the operationmode is set to “4” and the numbers of the crank pulses are shifted by aphase of 360°. Thereby, the true stroke is detected and the strokedetection is completed.

FIG. 14 shows the variation in crank pulses (the numbers thereof), theoperation mode, injection pulses, ignition pulses, intake air pressureand engine rotational speed with time at the time when the engine startsto rotate from compression top dead center. Numbering, setting of theoperation mode, setting of the fuel injection amount and the fuelinjection timing, and setting of the ignition timing immediately afterthe start of the rotation are performed in the same manner as shown inFIG. 12. The crank pulse “6” after the tooth missing part after theoperation mode has been set to “2” indicates bottom dead center afterexplosion, so that the temporary stroke coincides with the true stroke.In this simulation, the engine starts to rotate from compression topdead center, so that fuel injected by the starting asynchronousinjection and fuel injected by starting synchronous injection performedduring the second rotation of the crankshaft are sucked into thecombustion chamber by the intake stroke during the second rotation ofthe crankshaft and make an initial explosion by ignition at compressiontop dead center during the third rotation of the crankshaft, whereby theengine starts to rotate. Prior to this, since the engine rotationalspeed generated by the starter motor becomes the prescribed rotationalspeed for permitting stroke detection or higher, stroke detection ispermitted. However, the rotation of the engine is still unstable and theengine has not gone into a stable idling state.

Also in this simulation, after the operation mode has been set to “3”,stroke detection based on an engine rotational speed difference ΔN andstroke detection based on an intake air pressure difference ΔP areperformed at each bottom dead center. In this simulation, the enginerotational speed difference ΔN becomes the threshold value ΔN_(EX) ofengine rotational speed difference before exhaust stroke or greater atthe first bottom dead center after the operation mode has been set to“3”, which means the temporary stroke coincides with the detectedstroke. Thus, the flag F_(N) for stroke detection based on enginerotational speed difference is set to “1” and the counter CNT_(N) forstroke detection based on engine rotational speed difference isincremented to “1”. Then, at the second bottom dead center, the enginerotational speed difference ΔN is the threshold value ΔN_(IN) of enginerotational speed difference after intake stroke or smaller, which meansthat the temporary stroke coincides with the detected stroke. Thus, theflag F_(N) for stroke detection based on engine rotational speeddifference is kept at “1” and the counter CNT_(N) for stroke detectionbased on engine rotational speed difference is incremented and countedup to “2”. Then, since the counter CNT_(N) for stroke detection based onengine rotational speed difference counts up with the flag F_(N) forstroke detection based on engine rotational speed difference at “1”, thetemporary stroke detection is completed.

Thereafter, since the engine rotational speed difference ΔN is thethreshold value Δ_(EX) of engine rotational speed difference beforeexhaust stroke or greater at the next bottom dead center, which meansthe temporary stroke coincides with the detected stroke, the flag F_(N)for stroke detection based on engine rotational speed difference is keptat “1” and the counter CNT_(N) for stroke detection based on enginerotational speed difference is incremented to “3”. At the next bottomdead center, the engine rotational speed difference ΔN is the thresholdvalue ΔN_(IN) of engine rotational speed difference after intake strokeor smaller, which means that the temporary stroke coincides with thedetected stroke, so that the flag F_(N) for stroke detection based onengine rotational speed difference is kept at “1” and the counterCNT_(N) for stroke detection based on engine rotational speed differenceis incremented to “4”. At the same time, the intake air pressuredifference ΔP is the threshold value ΔP_(IN) of intake air pressuredifference after intake stroke or smaller at the bottom dead center,which means that the temporary stroke coincides with the detectedstroke, the flag F_(P) for stroke detection based on intake air pressuredifference is set to “1”, and the counter CNT_(P) for stroke detectionbased on intake air pressure difference is incremented to “1”. As aresult of this, the operation mode is set to “4” and the numbersattached to the crank pulses are left unchanged as the true strokes, andthe stroke detection is completed.

In the above embodiment, description has been made of an engine of thetype in which fuel is injected into an intake pipe but the enginecontrol device of the present invention is applicable to a directinjection engine.

Also in the above embodiment, description has been made of asingle-cylinder engine but the engine control device of the presentinvention is applicable to a multi-cylinder engine having two or morecylinders.

The engine control unit may be an operation circuit instead of themicrocomputer.

INDUSTRIAL APPLICABILITY

As has been described above, according to the engine control device ofthe present invention, a stroke is detected based on variation in intakeair pressure and a stroke is detected based on variation in enginerotational speed, and the stroke detection is completed when thedetected strokes coincide with each other. Thus, there is no need toselect a stroke detection method according to the engine operatingcondition. Also, since the low reliability of each detection method canbe compensated, the reliability of the detected stroke is high.

1. An engine control device, comprising: crankshaft phase detectingmeans for detecting a phase of a crankshaft; intake air pressuredetecting means for detecting an intake air pressure in an intake pipeof an engine; stroke detecting means for detecting a stroke of theengine based on at least the phase of the crankshaft detected by thecrankshaft phase detecting means; engine control means for controllingan operating condition of the engine based on the stroke of the enginedetected by the stroke detecting means and the intake air pressuredetected by said intake air pressure detecting means; and enginerotational speed detecting means for detecting an engine rotationalspeed, wherein the stroke detecting means detects a stroke based on avariation in intake air pressure detected by the intake air pressuredetecting means and detects a stroke based on a variation in the enginerotational speed detected by the engine rotational speed detectingmeans, and completes stroke detection when the detected strokes coincidewith each other.
 2. An engine control device, comprising: a crank anglesensor that detects a phase of a crankshaft; an intake air pressuresensor that detects an intake air pressure in an intake pipe of anengine; a stroke detection permitting part that detects a stroke of theengine based on at least the phase of the crankshaft detected by thecrank angle sensor; an engine control unit that controls an operatingcondition of the engine based on the stroke of the engine detected bythe stroke detection permitting part and the intake air pressuredetected by the intake air pressure sensor; and an engine rotationalspeed calculating part that detects an engine rotational speed, whereinthe stroke detection permitting part detects a stroke based on avariation in intake air pressure detected by the intake air pressuresensor and detects a stroke based on a variation in the enginerotational speed detected by the engine rotational speed calculatingpart, and completes stroke detection when the detected strokes coincidewith each other.
 3. The engine control device according to claim 2,wherein the crankshaft includes a plurality of teeth.
 4. The enginecontrol device according to claim 2, wherein the crank angle sensor is amagnetic sensor.
 5. The engine control device according to claim 3,wherein the plurality of teeth are formed on an outer periphery of thecrankshaft at equal intervals.
 6. The engine control device according toclaim 2, wherein the engine control unit is a microcomputer.
 7. Theengine control device according to claim 2, wherein the enginerotational speed calculating part calculates the rotational speed of thecrankshaft as an output shaft of the engine.
 8. The engine controldevice according to claim 2, wherein the stroke detection permittingpart outputs stroke detection permitting information.
 9. The enginecontrol device according to claim 2, wherein the engine rotational speedcalculating part calculates instantaneous engine speeds at top andbottom dead centers.
 10. The engine control device according to claim 2,further comprising a cooling water temperature sensor that detects atemperature of the engine.
 11. The engine control device according toclaim 2, further comprising an exhaust air-fuel ratio sensor thatdetects an air-fuel ratio of an exhaust pipe.
 12. The engine controldevice according to claim 2, further comprising an intake temperaturesensor that defects a temperature of the intake pipe.
 13. A method formanufacturing an engine control device, comprising: detecting a phase ofa crankshaft; detecting an intake air pressure in an intake pipe of anengine; detecting a stroke of the engine based on at least the phase ofthe crankshaft; controlling an operating condition of the engine basedon the stroke of the engine and the intake air pressure; detecting anengine rotational speed; detecting a stroke based on a variation inintake air pressure; detecting a stroke based on a variation in theengine rotational speed; and completing stroke detection when thedetected strokes coincide with each other.
 14. The method formanufacturing an engine control device according to claim 13, furthercomprising providing the crankshaft with a plurality of teeth.
 15. Themethod for manufacturing an engine control device according to claim 14,further comprising forming the plurality of teeth on an outer peripheryof the crankshaft at equal intervals.
 16. The method for manufacturingan engine control device according to claim 13, further comprisingcalculating the rotational speed of the crankshaft as an output shaft ofthe engine.
 17. The method for manufacturing an engine control deviceaccording to claim 13, further comprising outputting stroke detectionpermitting information.
 18. The method for manufacturing an enginecontrol device according to claim 13, further comprising calculatinginstantaneous engine speeds at top and bottom dead centers.
 19. Themethod for manufacturing an engine control device according to claim 13,further comprising detecting a temperature of the engine.
 20. The methodfor manufacturing an engine control device according to claim 13,further comprising detecting an air-fuel ratio of an exhaust pipe.